<?php

App::uses('CrudController', 'Controller');
App::uses('Line', 'Model');

class UserLinesController extends CrudController {

    public $_model = 'UserLine';

    public function admin($userId) {
        $this->request->allowMethod('get');
        $this->layout = 'empty';
        $appBosch = new stdClass();
        $appBosch->userId = $userId;
        $this->set('appBosch', $appBosch);
    }

    protected function getRecords($param) {
        $m = $this->_model;
        $userSessionId = $this->Auth->user('id');
        $userLines = $this->UserLine->getByUserAndSesionUser($param, $userSessionId);
        return $userLines;
    }

    protected function c($model) {
        return array();
    }

    protected function u($model) {
        return array(
            'assign_date' => $model->assign_date,
        );
    }

    protected function resultUpdate($id, $result) {
        $m = $this->_model;
        $userSessionId = $this->Auth->user('id');
        $userLines = $this->UserLine->getByUserAndSesionUser($param, $userSessionId);
        return $userLines;
    }

}
